Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slim Down #21

Merged
merged 11 commits into from
Oct 2, 2020
Merged

Slim Down #21

merged 11 commits into from
Oct 2, 2020

Conversation

mgreystone
Copy link
Member

@mgreystone mgreystone commented Aug 23, 2020

I'd like to use authentic in a lambda@edge. Unfortunately, there are strict size limits, & authentic would need to be slimmed down significantly. This is my proposal:

  • Bump to latest jwks-rsa, which drops request in favor of axios & drops lodash
  • Drop gimme in favor of axios, since jwks-rsa is using it already
  • Drop funky
  • Drop ramda

Misc

  • Add node 12 travis while dropping node 6

* Removes request in favor of axios.
* Removes entire lodash package in favor of individual lodash packages.
* jwks-rsa already has axios as a dependent.
@mgreystone mgreystone requested review from a team August 23, 2020 18:38
Copy link

@chrismcleod chrismcleod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing broken, only suggestions to make it even smaller.

index.js Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
Copy link
Member

@tylerodonnell tylerodonnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good from an infosec perspective. I'm able to confirm that this PR doesn't change any functionality with how it previously worked. Nice job.

Copy link
Contributor

@kdstew kdstew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment otherwise looks good

index.js Outdated Show resolved Hide resolved
Copy link

@spencerfdavis spencerfdavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@dpbackes dpbackes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give this the ol' :stamp: on behalf of 360-web. As we start to roll this out, are there particular things we should have QA look for?

@mgreystone
Copy link
Member Author

As we start to roll this out, are there particular things we should have QA look for?

Not really. Just regressions, i think.

@jameswelle jameswelle requested a review from a team August 24, 2020 16:24
Copy link
Collaborator

@flintinatux flintinatux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm always down for adding Lambda support. The only suggestion/thought I'd have is that you can replace much of Ramda with tinyfunk. You'd get to keep the functional, but seriously cut down on file-size. Totally just a thought, though, since I see you've solved things in more imperative ways in some places.

@flintinatux
Copy link
Collaborator

@mgreystone, one more question: If the concern is for Lambda package size limits, have you considered using Lambda Layers?

@spencerfdavis
Copy link

image

@mgreystone
Copy link
Member Author

mgreystone commented Aug 24, 2020

@mgreystone, one more question: If the concern is for Lambda package size limits, have you considered using Lambda Layers?

I have not. I'm not sure i follow how i'd use layers to solve this problem? Especially in a lambda@edge? This does shave just shy of 2 MB the size of my lambda package, but i'm honestly not confident it's going to be enough...

@flintinatux
Copy link
Collaborator

The idea with layers is that you can put all of your deps in a layer, and your actual lambda code in the function itself. Each layer can be up to the max zip-file size supported by Lambda, and you can have up to 5 layers per function. So it increases the size limit of your uploads.

I've built Lambda's before where all the node modules were in a layer, and then the lambda function was just a single file. It's not a one-size-fits-all solution, and I'm not sure if our Jenkins flows supports it, but layers can help with upload size.

@mgreystone mgreystone merged commit 803e211 into master Oct 2, 2020
@mgreystone mgreystone deleted the slim branch October 2, 2020 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants